<extend name="Public/layout" />

<block name="body">
    <div class="row">
        <div class="col-md-12">
                <select id="jlogs" class="form-control" style="width: 200px;display:inline-block;margin-left:10px;">
                    <?php foreach($files as $k=>$_file):?>
                        <?php if($k>99)break;?>
                        <option value="{$_file}" <?php echo $_file==$file?'selected="selected"':'';?>>20{:str_replace('_','-',substr($_file,strlen(LOG_PATH)))}</option>
                    <?php endforeach;?>
                </select>
                <a id="jnew" class="" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array('new'=>1))}"> <i class="fa fa-plus"> </i> </a>
                <script>
                    $('#jlogs').change(function() {
                        var sp = window.location.href.search(/\?/) >= 0 ? '&' : '?';
                        window.location.href = "{:U(CONTROLLER_NAME.'/'.ACTION_NAME)}"+sp+"file="+$(this).val();
                    });
                    $('.content-header h1').append($('#jlogs'));
                    $('.content-header h1').append($('#jnew'));
                </script>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <pre class="flat" style="background:#000;color:#fff;font-size:14px;"><?php echo file_exists($file) ? file_get_contents($file) : '';?></pre>
        </div>
    </div>
    <script>setTimeout(function(){
        $('body').scrollTop(1000000);
    },0);</script>
</block>
